home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip: 2005 Utilities
/
CHIP Utilities 2005.7z
/
CHIP Utilities 2005.iso
/
images
/
freedos.img
/
LEVEL1
/
NTFS.CAB
/
bin
/
Ntfs.bat
next >
Wrap
DOS Batch File
|
2005-01-16
|
5KB
|
182 lines
@if "%debug%"=="" echo off
if "%1"==":" if not "%2"=="" goto %2
:: Ntfs Begin ::
if not exist %ramdrv%\bin\lmod.com %0 : _error missing lmod.com (check utils.%arcext%)
if not exist %ramdrv%\bin\varset.com %0 : _error missing varset.com (check utilz.%arcext%)
if not exist %ramdrv%\bin\ntfsdos.exe %0 : _error missing 'NTFSDOS.EXE'
:_start
echo. >%tmp%\_Ntfs.tmp
if not exist %ramdrv%\etc\global.set goto _noglob
type %ramdrv%\etc\global.set >%tmp%\_Ntfs.tmp
:_noglob
if not exist %ramdrv%\etc\Ntfs.set goto _nospec
type %ramdrv%\etc\Ntfs.set >%tmp%\_Ntfs.tmp
:_nospec
xgrep -sy "^[:s]*@*[:s]*s?e?t?[:s]*Ntfs_.+=" %tmp%\_Ntfs.tmp >%tmp%\_Ntfs.bak
if errorlevel 1 goto _noset
xgrep -sy "^[:s]*@*[:s]*set[:s]+" %tmp%\_Ntfs.bak >%tmp%\_Ntfs.bat
xgrep -syv "^[:s]*@*[:s]*set[:s]+" %tmp%\_Ntfs.bak >%tmp%\_Ntfs.tmp
if errorlevel 1 goto _runset
lmod /L* set []<%tmp%\_Ntfs.tmp >>%tmp%\_Ntfs.bat
:_runset
call %tmp%\_Ntfs.bat
:_noset
if "%Ntfs_ti%"=="" set Ntfs_ti=5
for %%i in (-u -U) do if "%1"=="%%i" goto _unload
if "%1"=="/u" goto _unload
if "%1"=="/U" goto _unload
for %%i in (-c -C) do if "%1"=="%%i" goto _config
if "%1"=="/c" goto _config
if "%1"=="/C" goto _config
for %%i in (-h -H -?) do if "%1"=="%%i" goto _usage
if "%1"=="/h" goto _usage
if "%1"=="/H" goto _usage
if "%1"=="/?" goto _usage
if "%Ntfs_ncfg%"=="1" goto _nocfg
set wcb1=%Ntfs_install%
call w.bat box @%0:w_cfg #2,%Ntfs_ti%
if errorlevel 3 goto _end
set Ntfs_install=%wcb1%
if errorlevel 2 goto _config
:_nocfg
:_install
if "%Ntfs_install%"=="1" goto _dosbios
echo NTFS: Skipping NTFS Support (NTFS not installed)
goto _end
:_dosbios
set _ntfs=
if not "%ntfs_drv%"=="" set _ntfs=%_ntfs% /L:%ntfs_drv%
if not "%ntfs_size%"=="" set _ntfs=%_ntfs% /C:%ntfs_size%
if "%ntfs_unicode%"=="1" set _ntfs=%_ntfs% /U
if "%ntfs_ncomp%"=="1" set _ntfs=%_ntfs% /N
if "%ntfs_nxint13%"=="1" set _ntfs=%_ntfs% /X
if "%ntfs_verbose%"=="1" set _ntfs=%_ntfs% /V
echo NTFS: Installing NTFSDOS%_ntfs%
if exist %ramdrv%\bin\snap.com %ramdrv%\bin\snap.com S=%tmp%\ntfs.bin >%tmp%\nul
%ldh% %ramdrv%\bin\ntfsdos.exe %_ntfs% %1 %2 %3 %4 %5 %6 %7 %8
goto _end
:_unload
if not exist %tmp%\ntfs.bin goto _end
if not exist %ramdrv%\bin\snap.com goto _end
echo NTFS: Unloading NTFSDOS
%ramdrv%\bin\snap.com R=%tmp%\ntfs.bin >%tmp%\nul
del %tmp%\ntfs.bin >%tmp%\nul
goto _end
:_config
echo :w_config "NTFS configuration" [x]>%tmp%\_Ntfs.tmp
echo.>>%tmp%\_Ntfs.tmp
echo Dialog timeout [$ Ntfs_ti,3] seconds.>>%tmp%\_Ntfs.tmp
echo [!] Skip "Install NTFS or go config?" dialog>>%tmp%\_Ntfs.tmp
echo.>>%tmp%\_Ntfs.tmp
echo [.] Install NTFS (read-only) Support >>%tmp%\_Ntfs.tmp
echo [$ Ntfs_drv,20,U] Drive letters to use >>%tmp%\_Ntfs.tmp
echo [$ Ntfs_size,6] XMS cache size (KB) >>%tmp%\_Ntfs.tmp
echo [!] Tolerate unicode filenames >>%tmp%\_Ntfs.tmp
echo [!] Disable compression support >>%tmp%\_Ntfs.tmp
echo [!] Disable extended int 13 support >>%tmp%\_Ntfs.tmp
echo [!] Verbose >>%tmp%\_Ntfs.tmp
echo.>>%tmp%\_Ntfs.tmp
echo [.] Do NOT install NTFS support >>%tmp%\_Ntfs.tmp
echo.>>%tmp%\_Ntfs.tmp
echo [ Save ] [? Cancel ]>>%tmp%\_Ntfs.tmp
set wcb1=%Ntfs_ncfg%
set wcb2=%Ntfs_unicode%
set wcb3=%Ntfs_ncomp%
set wcb4=%Ntfs_nxint13%
set wcb5=%Ntfs_verbose%
set wrb=2
if "%Ntfs_install%"=="1" set wrb=1
call w.bat box @%tmp%\_Ntfs.tmp:w_config
if errorlevel 2 goto _end
set Ntfs_ncfg=%wcb1%
set Ntfs_unicode=%wcb2%
set Ntfs_ncomp=%wcb3%
set Ntfs_nxint13=%wcb4%
set Ntfs_verbose=%wcb5%
set Ntfs_install=%wrb%
if not "%wrb%"=="1" set Ntfs_install=0
set t_out=1
call drd.bat %srcdrv%
if errorlevel 1 set t_out=0
wbat box @%0:w_wprot #1,%t_out%
set t_out=
if errorlevel 2 goto _start
echo NTFS: Saving configuration...
set | tfind /f1,5 "Ntfs_">%tmp%\_Ntfs.bat
if not exist %srcdrv%\etc\*.* mkdir %srcdrv%\etc
if not exist %ramdrv%\etc\global.set goto _yglob
xgrep -syv "^[:s]*@*[:s]*s?e?t?[:s]*Ntfs_.+=" %ramdrv%\etc\global.set >>%tmp%\_Ntfs.bat
:_yglob
type %tmp%\_Ntfs.bat >%srcdrv%\etc\global.set
type %tmp%\_Ntfs.bat >%ramdrv%\etc\global.set
if exist %srcdrv%\etc\Ntfs.set del %srcdrv%\etc\Ntfs.set >%tmp%\nul
if exist %ramdrv%\etc\Ntfs.set del %ramdrv%\etc\Ntfs.set >%tmp%\nul
echo NTFS: Configuration saved to %srcdrv%\etc\global.set
echo.
goto _start
:w_cfg "Install NTFS or go config?" [x]
(~press any key~: #? sec.)
[!] Installing NTFS support ...
[ Ok ] [ Config ] [? Abort ]
::
:w_wprot "Disable write protection..." [x]
If the disk in drive %srcdrv% is write
protected, please disable the write
protection now in order to save settings.
You can re-enable write protection after
saving.
[ Ok ] [? Cancel ]
::
:_usage
echo Parameters:
echo -c Config mode
echo -u Unload
echo -h This help info
echo.
goto _end
:_error
shift
shift
echo.
echo NTFS: Error%errorlevel% %1 %2 %3 %4 %5 %6 %7 %8
echo.
@rem pause
goto _end
:_abort
echo NTFS: Aborted...
echo.
@rem pause
:_end
set | tfind /f1,2 "W_" >%tmp%\_Ntfs.tmp
set | tfind /f1,5 "Ntfs_" >>%tmp%\_Ntfs.tmp
type %tmp%\_Ntfs.tmp | lmod /L* /B= set [$1]=>%tmp%\_Ntfs.bat
call %tmp%\_Ntfs.bat
if exist %tmp%\_Ntfs.* del %tmp%\_Ntfs.*
set _ntfs=
set ?=
set wcb1=
set wcb2=
set wcb3=
set wcb4=
set wcb5=
set wcb6=
set wcb7=
set wcb8=
set wcb9=
set wrb=
set wbat=
:: Ntfs End ::